package
{
	import org.casalib.events.LoadEvent;
	import org.casalib.load.DataLoad;

	public class Setting
	{
		public static const WIDTH:int=1500;
		public static const HEIGHT:int=800;
		
		public static const PANEL_HEIGHT:int=300;
		
		public static const PRE_VIEW_HEIGHT:int=800;
		public function Setting()
		{
			
		}
		public static var baseValue:Object=new Object(); 
		public static function init(onComplete:Function):void
		{
			var loader:DataLoad=new DataLoad("config.xml");
			loader.addEventListener(LoadEvent.COMPLETE,_onComplete);
			loader.start();
			function _onComplete(e:LoadEvent):void
			{
				var configXML:XML=loader.dataAsXml;
				var length:int=configXML.children().length();
				for (var i:int = 0; i < length; i++) 
				{
					var propertyName:String=(configXML.children()[i].name() as QName).localName;
					var value:Number=configXML.children()[i].valueOf();
					baseValue[propertyName]=value;
				}
				onComplete.call();
			}
		}
		
	}
}